package com.yzh.design.demo;

import com.yzh.design.demo.cuisine.ICuisine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

public class XiaoEr {
    private Logger logger = LoggerFactory.getLogger(XiaoEr.class);
    private List<ICuisine> cuisineList = new ArrayList<>();
    
    public void order(ICuisine iCuisine) {
        cuisineList.add(iCuisine);
    }
    
    public void placeOrder() {
        for (ICuisine iCuisine : cuisineList) {
            iCuisine.cook();
        }
        cuisineList.clear();
    }
}
